// AI清单服务接口
import { get, post, put, del } from './api';
import { AiBooksItem, QueryParams } from '../pages/ai_books/models/aiBooksModels';

// API响应类型
interface ApiResponse<T> {
  code: number;
  message: string;
  data: T;
}


// 获取AI清单列表
export async function getAiBooks(params: QueryParams) {
  return get<ApiResponse<AiBooksItem[]>>('/aibooks');
}

// 添加AI清单项
export async function addAiBooks(AiBooksItem: Partial<AiBooksItem>) {
  return post<ApiResponse<AiBooksItem>>('/aibooks',AiBooksItem);
}

// 更新AI清单项
export async function updateAiBooks(id: number, data: Partial<AiBooksItem>) {
  return put<ApiResponse<AiBooksItem>>(`/aibooks/${id}`, data);
}

// 获取AI清单详情
export async function getAiBooksDetail(id: number) {
  return get<ApiResponse<AiBooksItem>>(`/aibooks/${id}`);
} 